<template>
  <div>
    <!-- 热门品牌 -->
    <section>
      <div class="trademark">
        <div class="container">
          <div class="good-title">
            <div class="title-left">
              <h1>热门品牌</h1>
              <span>国际经典 品牌保证</span>
            </div>
            <div class="title-right">
              <button>&#8249;</button>
              <button class="active">&#8250;</button>
            </div>
          </div>
          <div class="trademark-list">
            <ul>
              <li v-for="trademark in trademark" :key="trademark.id"><img :src="trademark.picture" alt="" /></li>
            </ul>
          </div>
        </div>
      </div>
    </section>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  mounted() {
    this.$store.dispatch("getTrademark");
  },
  computed: {
    ...mapState({
      trademark: (state) => state.home.trademark,
    }),
  },
};
</script>

<style>
.trademark {
  height: 460px;
  background-color: #f5f5f5;
}

.trademark .good-title {
  height: 115px;
  line-height: 115px;
}

.trademark .good-title .title-right button {
  width: 20px;
  height: 20px;
  border: 0;
  color: #eee;
  cursor: pointer;
}

.trademark .good-title .title-right button:first-child {
  background-color: gray;
  margin-right: 5px;
}

.active {
  background-color: #27ba9b;
}

.trademark .trademark-list {
  height: 345px;
}

.trademark .trademark-list ul {
  float: left;
  width: 1240px;
  height: 305px;
  overflow: hidden;
}

.trademark .trademark-list li {
  width: 240px;
  height: 305px;
  float: left;
}

.trademark .trademark-list ul li:not(:nth-child(5)) {
  margin-right: 10px;
}

.trademark .trademark-list li img {
  width: 100%;
  height: 100%;
}
</style>